/*
 * 〈描述〉
 *
 * @author Think
 * @since 版本号
 */

package com.duyj.rule.drools;

/**
 * 〈一句话功能简述〉
 *
 * <p>〈功能详细描述〉
 *
 * @author Think
 * @since 版本号
 */
public class RuleConstant {

    public static final String CHECK_RULE = "package rules;\n" +
            "dialect  \"mvel\"\n" +
            "import com.duyj.model.dto.UserDto\n" +
            "rule \"userCode\"\n" +
            "    when\n" +
            "       :userDto : UserDto(userCode != '100')\n" +
            "    then\n" +
            "       System.out.println(\"错误11212\");\n" +
            "end";

    public static final String SET_VALUE_RULE =
            "package rules;\n" +
                    "dialect  \"java\"\n" +
                    "\n" +
                    "import com.duyj.rule.model.datarow.DataRow;\n" +
                    "import com.duyj.rule.model.dto.UserDTO;\n" +
                    "\n" +
                    "rule \"setUserCode\"\n" +
                    "    no-loop true\n" +
                    "    when\n" +
                    "        $dataRow : DataRow()\n" +
                    "        $userDto : UserDTO()\n" +
                    "    then\n" +
                    "        $userDto.setUserCode($dataRow.findDataRow(\"tableName\").getColumnValue(\"userCode\").toString());\n" +
                    "        $userDto.setUserName($dataRow.findDataRow(\"tableName\").getColumnValue(\"userName\").toString());\n" +
                    "        $userDto.setUserName2($dataRow.findDataRow(\"tableName\").getColumnValue(\"userName2\").toString());\n" +
                    "end";
}
